package com.Servlet;

import com.Service.Impl.UserServiceImpl;
import com.Service.UserService;
import com.entity.User;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Author: 冷俊杰
 * @Description: 模糊查询用户
 * @DateTime: 2022/6/21 14:39
 **/
@WebServlet(name = "/LISTUer", value = "/LISTUer")
public class LISTUer extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        UserService service = new UserServiceImpl();
        String phone = request.getParameter("phone");
        List<User> LISTUer = service.LISTUer(phone);
        request.setAttribute("LISTUer", LISTUer);
        request.getRequestDispatcher("./UserManage.jsp").forward(request, response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }
}
